<div id="${pagination.pageId?default("Pagination-Page")}"></div>
	<!-- Templates -->
	<textarea id="${pagination.templateId?default("Pagination-ContentTemplate")}" rows="0" cols="0" style="display:none">
		${pagination.bodyContent.getString()}
	</textarea>
<#--设置默认排序字段-->
<#assign sortname="">	
<#assign sortorder="ASC">	
<#list pagination.grid.columnList as column >
    <#if column.defaultSort=="true" >
	   <#assign sortname=column.name>
	   <#assign sortorder=column.defaultSortOrder>
	   <#break>
   </#if>
</#list>	
    <script>
    	//json分页对象
    	var jsonMyPagination;
    	//分页初始参数
		var iniPaginationParameters = "";
		iniPaginationParameters +="&rp=${pagination.encode(pagination.rp?default("10"),"UTF-8")}"; //
		iniPaginationParameters +="&sortname="+"${pagination.encode(sortname,"UTF-8")}"; //
		iniPaginationParameters +="&sortorder="+"${pagination.encode(sortorder,"UTF-8")}"; //
		iniPaginationParameters +="&query=${pagination.encode(pagination.queryValue?default(""),"UTF-8")}"; //
		iniPaginationParameters +="&qtype=${pagination.encode(pagination.queryColumn?default(""),"UTF-8")}";//
		iniPaginationParameters +="&dynamic=${pagination.encode(pagination.dynamicValue?default(""),"UTF-8")}";//
		iniPaginationParameters +="&dtype=${pagination.encode(pagination.dynamicColumn?default(""),"UTF-8")}";//
		iniPaginationParameters +="&fishergrid=${pagination.encode(pagination.name,"UTF-8")}";//
		iniPaginationParameters = decodeURI(iniPaginationParameters);
		//alert(iniPaginationParameters);	
        jsonMyPagination = $("#${pagination.pageId?default("Pagination-Page")}").myPagination({
          currPage: ${pagination.page?default("1")?js_string},
          pageCount: ${pagination.pageCount?default("10")?js_string},
          pageNumber: ${pagination.pageNumber?default("10")?js_string},
          cssStyle: '${pagination.cssStyle?default("digg")?js_string}',
          panel: {
          	first:"${pagination.first?default("首页")?js_string}",
          	last:"${pagination.last?default("尾页")?js_string}",
          	next:"${pagination.next?default("下一页")?js_string}",
          	prev:"${pagination.prev?default("上一页")?js_string}",
          	first_on: ${pagination.firstOn?default("true")?js_string},
          	last_on: ${pagination.lastOn?default("true")?js_string},
          	next_on: ${pagination.nextOn?default("true")?js_string},
          	prev_on: ${pagination.prevOn?default("true")?js_string},
          	links: "${pagination.links?default("")?js_string}",
            tipInfo_on: ${pagination.tipInfoOn?default("true")?js_string},
            tipInfo: '${pagination.tipInfo?default("&nbsp;&nbsp;跳{input}/{sumPage}页")?js_string}',
            tipInfo_css: {
				${pagination.tipInfoCss?default("")?js_string}
            }
          },
          debug: ${pagination.isDeveloperMode()?string?js_string},
          ajax: {
            on: true,
            url: "${pagination.getReqeustSearchURL(contextPath+pagination.url?default("/fisher/jsp/paginationdata.jsp"))?js_string}",
            type: "${pagination.method?default("POST")?js_string}",
            dataType: '${pagination.dataType?default("json")?js_string}',
            param: iniPaginationParameters,
            pageCountId: '${pagination.pageCountId?default("total")?js_string}',
            ajaxStart: function() {
            	${pagination.ajaxStart?default("paginationDefaultAjaxStart")}("${pagination.pageId?default("Pagination-Page")}","${pagination.templateId?default("Pagination-ContentTemplate")}","${pagination.contentId?default("Pagination-Content")}");
            },
            ajaxStop: function() {
            	${pagination.ajaxStop?default("paginationDefaultAjaxStop")}("${pagination.pageId?default("Pagination-Page")}","${pagination.templateId?default("Pagination-ContentTemplate")}","${pagination.contentId?default("Pagination-Content")}");
            },
            onClick: function(page) {
            	${pagination.onClick?default("paginationDefaultOnClick")}("${pagination.pageId?default("Pagination-Page")}","${pagination.templateId?default("Pagination-ContentTemplate")}","${pagination.contentId?default("Pagination-Content")}",page);
            },
            callback: function(data) {
            	${pagination.callback?default("paginationDefaultCallback")}("${pagination.pageId?default("Pagination-Page")}","${pagination.templateId?default("Pagination-ContentTemplate")}","${pagination.contentId?default("Pagination-Content")}",data);
            }	
          }
        });
        //字段过滤配置信息
        var paginationFilters={
        <#assign searchCount=0>
		<#list pagination.grid.columnList as column >
		  <#if column.searchable=="true" && column.visual=="true" >
		  	 <#if searchCount!=0>,</#if>
		  	 ${column.name}:{
						  	 id:"${column.type?js_string}#${column.display?js_string}#${pagination.grid.getColumnFilter(column).getValidatePattern()?default("")?js_string}#${pagination.grid.getColumnFilter(column).getValidateMessage()?default("")?js_string}",
						  	 name:"fisher#value#${column.name?js_string}",
						  	 type:"fisher#type#${column.name?js_string}",
						  	 types:[
									<#list pagination.grid.getColumnFilter(column).getConditionOptions(column) as options >
									    {
										name:"${options.name?js_string}",
										value:"${options.value?js_string}"
									    },
									</#list>	
							 		]
							 <#if pagination.grid.getColumnFilter(column).getValueOptions(column)?exists>		
							 		,	
							 options:[ 	 
									<#list pagination.grid.getColumnFilter(column).getValueOptions(column) as options >
									    {
										name:"${options.name?js_string}",
										value:"${options.value?js_string}"
									    },
									</#list>				  	 
						  	 		]
						  	 </#if>
		  	 }
		  	<#assign searchCount=searchCount+1>
		  </#if>				
		</#list>		          	
        };
        paginationFilter("${pagination.filterTemplateId?default("Pagination-FilterTemplate")}","${pagination.filterId?default("Pagination-Filter")}",paginationFilters);
        function onDoPaginationSearch(){
        	paginationSearch(jsonMyPagination,iniPaginationParameters);
        }
    </script>